package com.boss.salary.service;

import com.boss.common.entity.PageDTO;
import com.boss.framework.dto.PaginationDTO;
import com.boss.framework.exception.AppRuntimeException;
import com.boss.salary.entity.AgencyVerify;
import com.boss.salary.entity.SalaryRental;
import com.boss.salary.vo.unitReportVO;
import com.boss.sys.ca.user.dto.UserDTO;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.util.List;
import java.util.Map;

public interface IAgencyVerifyService {
    /**
     * 增加 机构上报审核状态表数据
     * @param agencyVerify
     * @return
     */
    void saveAgencyVerify(AgencyVerify agencyVerify);

    /**
     * 更新 机构上报审核状态表数据
     * @param agencyVerify
     * @return
     */
    void updateAgencyVerify(UserDTO userDTO, AgencyVerify agencyVerify) throws AppRuntimeException;

    /**
     * 单位上报
     * @param userDTO
     * @param agencyVerify
     * @throws AppRuntimeException
     */
    void reportUnitSalary(UserDTO userDTO, AgencyVerify agencyVerify) throws AppRuntimeException;

    /**
     * 单位撤销上报
     * @param userDTO
     * @param agencyVerify
     * @throws AppRuntimeException
     */
    void reportRevokeUnitSalary(UserDTO userDTO, AgencyVerify agencyVerify) throws AppRuntimeException;

    /**
     * 单位上报退回
     * @param agencyVerify
     */
    void reportUnitSalaryBack(AgencyVerify agencyVerify, UserDTO userDto);

    /**
     * 应发、实发确认
     * @param salaryRental
     */
    void updateSalaryVerify(UserDTO userDTO, SalaryRental salaryRental) throws AppRuntimeException;

    /**
     * 应发、实发工资撤销确认
     * @param salaryRental
     */
    void sendBackSalaryVerify(UserDTO userDto, SalaryRental salaryRental) throws AppRuntimeException;
    /**
     * 单位变动人数
     * @param agencyId
     */
    void updateChangePersonNum(String agencyId);
    /**
     * 增加人数
     * @param agencyId
     */
    void updateAddPersonNum(String agencyId);

    /**
     * 增加离休人数
     * @param agencyId
     */
    void updateAddQuitPersonNum(String agencyId);

    /**
     * 消减人数
     * @param agencyId
     */
    void updateDeletePersonNum(String agencyId);
    /**
     * 应发、实发工资退回
     * @param salaryRental
     */
    void sendBackSalaryVerify1(UserDTO userDto, SalaryRental salaryRental) throws AppRuntimeException, JsonProcessingException;

    /**
     * 获取本月新增人数
     * @param agencyId
     * @return
     */
    int getAddPersonNumByAgencyId(String agencyId);

    /**
     * 十三月工资：查询历史月份列表
     * @return
     */
    List<String> getHistoryMonthList(String agencyId);

    /**
     * 获取单位审核状态表未月结的所有数据
     * @return
     */
    List<AgencyVerify> getAgencyVerifyInfo();

    /**
     * 获取单位上报情况
     * @param paginationDTO
     * @param state 单位上报状态
     * @return
     */
    PageDTO<unitReportVO> getUnitReportPage(PaginationDTO paginationDTO, String state, List<String> childrenId, String mofDivCode ,String is_auto);

    /**
     * 根据单位id获取审核信息
     * @param agencyId
     * @return
     */
    AgencyVerify getAgencyVerifyByAgencyId(String agencyId);

    /**
     * 根据单位id判断是否生成工资数据
     * @param agencyIds
     * @return
     */
    boolean getSalaryDataByAgencyId(List<String> agencyIds);

    /**
     * 获取人员重复信息
     * @param userDto
     * @param agencyIds
     * @return
     */
    List<Map<String,Object>> selectOverlapPersionInfo(UserDTO userDto,List<String> agencyIds);

    /**
     * 查看单位数据是否有变动
     * @param agencyId
     * @return
     */
    boolean checkAgencyIsChanged(String agencyId) throws Exception;

    /**
     * 同步数据 插入
     * @param userDTO
     * @param agencyVerifyList
     * @return
     */
    List<AgencyVerify> insertAgencyLnIt(UserDTO userDTO, List<AgencyVerify> agencyVerifyList);

    List<Map<String, Object>> selectPersonTransfer(String province, String month);

    /**
     * 查询月份
     * @param province
     * @return
     */
    String currentMonth(String province);
    /**
     * 查询年份
     * @param province
     * @return
     */
    String currentYear(String province);

    List<AgencyVerify> queryAgencyVerify(List<AgencyVerify> agencyVerifies);
}
